<% layout('/layouts/default.html', {title: '平均温度', libs: ['dataGrid']}){ %>
<script src="${ctxStatic}/jquery/jquery-ui-1.12.1.min.js"></script>
<script src="${ctxStatic}/js/share.js"></script>
<link rel="stylesheet" href="${ctxStatic}/jquery/jquery-ui-1.9.2.custom.css" type="text/css">
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('平均温度')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${abData}" action="${ctx}/ab/abData/pingjunData" method="post" class="form-inline"
			data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
			<div class="form-group">
				<label class="control-label">${text('行政区域')}：</label>
				<div class="control-inline">
					<#form:treeselect id="areaCode" title="${text('区域选择')}"
					path="areaCode" labelPath=""
					url="${ctx}/sys/area/treeData" allowClear="true"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label">${text('供热公司部门')}：</label>
				<div class="control-inline">
					<#form:treeselect id="companyCode" title="${text('机构选择')}"
					path="companyCode" labelPath=""
					url="${ctx}/sys/office/treeData" allowClear="true"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label">${text('小区楼宇')}：</label>
				<div class="control-inline">
					<#form:treeselect id="floorCode" title="${text('楼宇选择')}"
					path="floorCode" labelPath=""
					url="${ctx}/ab/abFloorTree/treeData" allowClear="true"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label">${text('小区楼宇')}：</label>
				<div class="control-inline">
					<input type="text" class="ui-datepicker-time" readonly value="" />

					<div class="ui-datepicker-css">
						<div class="ui-datepicker-quick">
							<p>快捷日期<a class="ui-close-date">X</a></p>
							<div>
								<input class="ui-date-quick-button" type="button" value="今天" alt="0"  name=""/>
								<input class="ui-date-quick-button" type="button" value="昨天" alt="-1" name=""/>
								<input class="ui-date-quick-button" type="button" value="7天内" alt="-6" name=""/>
								<input class="ui-date-quick-button" type="button" value="14天内" alt="-13" name=""/>
								<input class="ui-date-quick-button" type="button" value="30天内" alt="-29" name=""/>
								<input class="ui-date-quick-button" type="button" value="60天内" alt="-59" name=""/>
							</div>
						</div>
						<div class="ui-datepicker-choose">
							<p>自选日期</p>
							<div class="ui-datepicker-date">
								<input name="startDate" id="startDate" class="startDate" readonly value="2014/12/20" type="text">
								-
								<input name="endDate" id="endDate" class="endDate" readonly  value="2014/12/20" type="text" disabled onChange="datePickers()">

							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label">${text('查看等级')}：</label>
				<div class="control-inline">
					<select class="head_box2_sel" style="width: 40px;float: left;" name="level" value="byday" id="sel1">
						<option value="hu" selected='selected'>户</option>
						<option value="lou" >楼</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label">${text('查看日期')}：</label>
				<div class="control-inline">
					<select class="head_box2_sel" style="width: 70px;float: left;" name="bydate" value="byday" id="sel1">
						<option value="" >未选择</option>
						<option value="byday" selected='selected'>日</option>
						<option value="bymonth" >月</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<div class="control-inline">
					<#form:input type="search" name="host" placeholder="ID用户名" class="form-control width-120" style="float: left;" />
				</div>
			</div>
			<div class="form-group">
				<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
				<button type="reset" class="btn btn-default btn-sm">${text('清空')}</button>
				<button type="button" class="btn btn-default btn-sm">${text('图表')}</button>
				<button type="button" class="btn btn-default btn-sm">${text('导出')}</button>
			</div>
		</#form:form>
		<table id="dataGrid"></table>
		<div id="dataGridPage"></div>
	</div>
</div>
</div>
<% } %>
<script>
	// 初始化DataGrid对象
	$('#dataGrid').dataGrid({
		searchForm: $("#searchForm"),
		columnModel: [
			{header:'${text("用户名")}', name:'name', index:'a.name', width:100, align:"left"},
			{header:'${text("测温id")}', name:'equipNo', index:'a.equip_no', width:100, align:"left"},
			{header:'${text("平均温度")}', name:'inValue', index:'in_value', width:100, align:"right", formatter: function(val, obj, row, act){
					return js.formatNumber(val, 2, false, '') + "℃"; // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
				}},

			// {header:'${text("面积")}', name:'createTime', index:'a.create_time', width:150, align:"center"},
			// {header:'${text("地址")}', name:'actions', width:120, index:'a.' sortable:false, title:false},
			{header:'${text("供热公司部门")}', name:'companyName', index:'a.company_name', width:150, align:"left"}

		],
		// 加载成功后执行事件
		ajaxSuccess: function(data){

		}
	});
</script>